<#assign contextPath=springMacroRequestContext.getContextPath() />
<#import "/public/frame/main.html" as frame />
<@frame.head "南航明珠商城-<#if isaudit>审核<#else>查看</#if>商品">
</@frame.head>

<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 后台管理中心 <span class="c-gray en">&gt;</span> 促销管理 <span class="c-gray en">&gt;</span> <#if isaudit>审核<#else>查看</#if>商品 </nav>
<div class="page-container">	
		<input type="hidden" id="prodId" name="presentId" value="${presentInfo.id?c}"	 /> 
		  <h1>赠品基本信息</h1>	
          <table class="table" border="0">
           <tr>
              <td>赠品名称：</td><td colspan="1">  <input  disabled="disabled"  class="input-text  radius" type="text"  name="presentInfo.name"  size="72" maxlength="50" value="${presentInfo.name}" />   </td>
           </tr> 
             <tr>
                 <td>赠品库存：</td>
                 <td><input   disabled="disabled"   class="input-text  radius"   type="text" name="productAdmin.storeNum" value="${presentInfo.presentStock}" size="10" /> </td>
                 <td></td>
                 <td></td>
                 <td></td>
             </tr>
             <tr>
                 <td>剩余库存：</td>
                 <td><input   disabled="disabled"   class="input-text  radius"   type="text" name="productAdmin.storeNum" value="${presentInfo.presentStock-presentInfo.presentSaleStock}" size="10" /> </td>
                 <td></td>
                 <td></td>
                 <td></td>
             </tr>
             <tr>
                 <td>重量：</td>
                 <td><input   disabled="disabled"   class="input-text  radius"   type="text" name="productAdmin.storeNum" value="${presentInfo.presentWeight}" size="10" /> </td>
                 <td>kg</td>
                 <td></td>
                 <td></td>
             </tr>
             <tr>
                 <td>所属供应商：</td>
                 <td>  
                 <span  class="select-box radius">
                 	 <select class="select"  disabled="disabled" name="productAdmin.brandId"  >
	                           <option value="0" >--请选择--</option> 
                               <#list merchantList as merchant> 
									 <option value="${merchant.id?c}" <#if merchant.id==presentInfo.merchant.id>selected</#if> >${merchant.mercName}</option>
					           </#list>
	                 </select>
	             </span>
                 </td>
                 <td></td>
                 <td></td>
                 <td></td>
                 </tr>
                            

             
                 <tr>
                 <td>参考价格：</td> <td><input   disabled="disabled"  class="input-text  radius"  type="text" name="productAdmin.payOneMileage"  value="${presentInfo.presentPrice}" /></td><td>公里 </td> 
                 </tr>
                 <tr>
                 <td>进销存发货编码：</td> <td><input   disabled="disabled"  class="input-text  radius"  type="text" name="productAdmin.payOneMileage"  value="${skuCode}" /></td><td> </td> 
                 </tr>
          </table>
          <!-- tab1  end -->		
		  <!-- tab2 start -->	
          <h1>详细图片</h1>
         <table class="tab_iframe">
	        <tr>
	        <td><div id="show"      style="width:90px;height:90px;">
	             <img  id="image1" src="${webSite}/admin/images/no_img.jpg"  width="90" height="90"   />
	             </div>
	        </td>
	        <td><div id="show_1"    style="width:90px;height:90px;">  
	           <img  id="image2" src="${webSite}/admin/images/no_img.jpg"    width="90" height="90" />
	            </div>
	        </td>
	        <td><div id="show_2"    style="width:90px;height:90px;">
	            <img id="image3" src="${webSite}/admin/images/no_img.jpg"    width="90" height="90"  />
	            </div>
	         </td>
            <td><div id="show_3"   style="width:90px;height:90px;">
                <img  id="image4" src="${webSite}/admin/images/no_img.jpg"   width="90" height="90" />
                </div>
            </td>
	        <td><div id="show_4"    style="width:90px;height:90px;">
	            <img   id="image5" src="${webSite}/admin/images/no_img.jpg"   width="90"  height="90" />
	            </div>
	         </td>
	        </tr>
	      </table> 
	      <br />

		<br />
        <!-- tab3 start -->		
		<div >
		<br></br>
		<h1>商品详情</h1>
	     ${presentInfo.presentDesc} 
	  </div>
	   <!-- tab3 end -->
	    <!-- tab4 start -->	
     	 <!-- tab4 start -->
          
     <#if isaudit>
        </div>
		&nbsp;&nbsp;&nbsp;&nbsp;
		<input class="btn btn-danger radius" type="button" value="审核通过"  onclick="auditProduct('${productInfo.id?c}','3')" />
		<input class="btn btn-danger radius" type="button" value="审核不通过"  onclick="auditProduct('${productInfo.id?c}','3')" />
		<br><br><br>
		</div>	
     </#if> 
</div>
<@frame.end "default">
</@frame.end>
</body>
</html>
<script type="text/javascript" src="${contextPath}/resources/js/product/add_or_update_product.js"></script>
<script type="text/javascript">    
var path="${contextPath}";

function init(){
    showMainSpecs() ;
    showSpecs();     // 显示规格参数
    <#list imageList as pic> 
    var  picPath= "${imagePath}/shop/present/${pic.presentUuid}/${pic.image}";
    document.getElementById("image${pic.sequences+1}").src=picPath;
    </#list>
}

init();

<#if isaudit>
//商品审核
function auditProduct(prodId,status){  //显示规格参数  
var url="";
if(status=="4"){
   url=path + "/product/audit_product_one";
}else if(status=="5"){
   url=path + "/product/audit_product_two";
}else if(status=="2"){
   url=path + "/product/audit_product_three";
}else if(status=="3"){
   url=path + "/product/audit_product_fail";
}
if(url!=""){
$.ajax({
		url : url,
		cache : false,
		type : 'post',    
		dataType : 'html',
		data :{"prodId":prodId,"status":status},    
        error : function() {
        },
		success : function(data) {
		   if(data.charAt(0)=='1'){
			 layer.msg('您的审核操作成功!',{icon:1,time:1000},function(){
               var index = parent.layer.getFrameIndex(window.name); //获取窗口索引    
               parent.search();
               parent.layer.close(index);
			 });
		   }else if(data.charAt(0)=='2'){
			   layer.alert("审核失败！请确认当前商品的实际状态");
		   }else {
			   layer.alert("您的审核操作失败");    
		   }
		}
   }); 
 }
}
</#if>
</script>